//
// Created by wze-zero on 2024/9/13 013.
//
#include <iostream>
#include <cmath>

using namespace std;

bool test(int num) {
    int sum = 0;
    for (int i = 1; i < 5; ++i) {
        sum += (num % (int) pow(10, i)) * (num / (int) pow(10, i));
    }
    return num == sum;
}

int main() {
    for (int i = 10000; i < 100000; ++i) {
        if (test(i)) {
            cout << i << " ";
        }
    }
    return 0;
}